/**
 * bbxwlw.com
 * Copyright (C) 2013-2023 All Rights Reserved.
 */
package com.gg.template.config;

import cn.hutool.core.lang.generator.SnowflakeGenerator;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 *
 * @author guiguan
 * @version SnowFlakeConfig.java, v 0.1 2023-04-26 11:50
 */
@Configuration
@Getter
public class SnowFlakeConfig {

    @Value("${snowflake.workerId}")
    private Long workerId;

    @Value("${snowflake.dataCenterId}")
    private Long dataCenterId;
    @Bean
    public SnowflakeGenerator snowflakeGenerator() {
        return new SnowflakeGenerator(workerId,dataCenterId);
    }
}
